package com.k7k7.util;

import org.dom4j.Attribute;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;

import java.util.Iterator;

public class ElementUtil {

	@SuppressWarnings( { "unchecked" })
	public static void removeAllAttribute(Element ele) {
		for (Iterator i = ele.attributeIterator(); i.hasNext();) {
			ele.remove((Attribute) i.next());
		}
	}

	@SuppressWarnings("unchecked")
	public static void removeAllChild(Element ele) {
		for (Iterator i = ele.elementIterator(); i.hasNext();) {
			Element element = (Element) i.next();
			ele.remove(element);
		}
	}
	public static Element getMsg(){
		return DocumentHelper.createElement("msg");
	}

}
